<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome_Controller extends CI_Controller {

	function __construct()
    {
		parent::__construct();
		$this->template->set_template('home');   
		$this->load->model('product_model');
    }

	public function index()
	{
		
		$this->template->write_view('header', 'header_default_block', NULL, FALSE);
		$this->template->write_view('content', 'deals_block.php', NULL, FALSE);
		$this->template->write_view
		(
			  'content'
			, 'product_list_block.php'
			, array( 'block_title' => 'New Products', 'products' => $this->product_model->get_hot_product())
			, FALSE
		);

		// define canonical link
		$canonical_link = $this->config->config['base_url'].'/index.htm';
		// $current_url = $this->config->config['site_url'].$_SERVER['REQUEST_URI'];
		// if($canonical_link != $current_url)
		$this->html_meta['canonical'] = $canonical_link;
		$this->html_meta['robots'] = 'index, follow';
		
		$this->http_cache_filepath = '';
		$this->http_cache_filename = 'index.htm';
		$this->render_template = TRUE;
	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */